//  新增员工
import request from '@/utils/request'
export const sysUser = (params) => {
  return request({
    url: '/sys/user',
    params
  })
}
//  新增员工列表
export const sysuserPost = (data) => {
  return request({
    url: '/sys/user',
    method: 'post',
    data
  })
}
// 删除员工列表
export const sysuserDelete = (id) => {
  return request({
    url: '/sys/user/' + id,
    method: 'delete'
  })
}
//  批量导入员工
export const sysuSerBatch = (data) => {
  return request({
    url: '/sys/user/batch',
    method: 'post',
    data
  })
}
export const sysUserPut = (data) => {
  return request({
    url: '/sys/user/' + data.id,
    method: 'put',
    data
  })
}

//  获取员工基本信息
export const employeesPersonalInfo = (id) => {
  return request({
    url: `/employees/${id}/personalInfo`
  })
}
//  修改员工基本信息
export const employeesPersonalInfoPut = (data) => {
  return request({
    url: `/employees/${data.userId}/personalInfo`,
    method: 'put',
    data
  })
}
// 获取员工岗位信息
export const employeesJobs = (id) => {
  return request({
    url: `/employees/${id}/jobs`
  })
}
//  修改岗位基本信息
export const employeesJobsPut = (data) => {
  return request({
    url: `/employees/${data.userId}/jobs`,
    method: 'put',
    data
  })
}

//  给员工分配角色
export const sysuseraSsignRoles = (data) => {
  return request({
    url: '/sys/user/assignRoles',
    method: 'put',
    data
  })
}
